const obj = { foo: 'bar', baz: 42 };
console.log(Object.entries(obj))
// [ ["foo", "bar"], ["baz", 42] ]

const obj1 = { foo: 'bar', baz: 42 };
const map = new Map(Object.entries(obj1));
map // Map { foo: "bar", baz: 42 }
console.log(Object.prototype.toString.call(map))
const m = new Map();
console.log(Object.prototype.toString.call(m))